<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>this</title>
</head>

<body>
  <script>
    /*
    var name = '小白';
    function special() {
      console.log('姓名: ' + this.name);
    }

    var girl = {
      name: '小红',
      detail: function () {
        console.log('姓名: ' + this.name);
      },
      woman: {
        name: '小黄',
        detail: function () {
          console.log('姓名: ' + this.name);
        }
      },
      special: special
    }

    girl.detail(); // 小红
    girl.woman.detail(); // 小黄
    girl.special(); // 小红
    */
  </script>

  <script>
    var name = '小红';
    function a() {
      var name = '小白';
      console.log(this.name);
    }
    function d(i) {
      return i();
    }
    var b = {
      name: '小黄',
      detail: function () {
        console.log(this.name)
      },
      bibi: function () {
        return function () {
          console.log(this.name);
        };
      }
    }
    var c = b.detail;
    b.a = a;
    var e = b.bibi;
    a();
    c();
    b.a();
    d(b.detail);
    e();
  </script>
</body>

</html>